﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BaseLibrary.CDataContext;

namespace DataSyn.Controls
{
    public partial class UC_DataBase : DevExpress.XtraEditors.XtraUserControl
    {
        public UC_DataBase()
        {
            InitializeComponent();
        }

        private void UC_DataBase_Load(object sender, EventArgs e)
        {
            uDataBaseConnection1.ChangedConnection = () => {
                DataContext dc = new DataContext(uDataBaseConnection1.Provider, uDataBaseConnection1.ConnectionString);
                if (!dc.ConnTest)
                {
                    MessageBox.Show("数据库连接失败！");
                    return;
                }
            };
        }
    }
}
